var lineChart = document.getElementById('lineChart');
var bar2Chart = echarts.init(lineChart);
var bar2Option = {
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        }
    },
    legend: {
        data:['准时还款人数', '逾期人数', '总申请人数']
    },
    color,
    grid: {
        top: 30,
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'value'
        }
    ],
    yAxis : [
        {
            type : 'category',
            axisTick : {show: false},
            data : ['加盟宝','升级宝','贷款宝','项目宝','提货宝','一级经销商融资产品'],
            axisLabel: {
                rotate : 20
              },
        }
    ],
    series : [
        {
            name:'准时还款人数',
            type:'bar',
            label: {
                normal: {
                    show: true,
                    position: 'inside'
                }
            },
            data:[200, 170, 240, 244, 200, 220]
        },
        {
            name:'总申请人数',
            type:'bar',
            stack: '总量',
            label: {
                normal: {
                    show: true
                }
            },
            data:[320, 302, 341, 374, 390, 450]
        },
        {
            name:'逾期人数',
            type:'bar',
            stack: '总量',
            label: {
                normal: {
                    show: true,
                    position: 'left'
                }
            },
            data:[-120, -132, -101, -134, -190, -230]
        }
    ]
};
bar2Chart.setOption(bar2Option)